package com.cloudkinto.service.channel;

import com.baomidou.mybatisplus.extension.service.IService;
import com.cloudkinto.common.web.PageResult;
import com.cloudkinto.common.web.SingleResult;
import com.cloudkinto.entity.LogisticsChannelDo;
import com.cloudkinto.vo.channel.la.LaSwitchReq;
import com.cloudkinto.vo.channel.lc.*;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * service接口
 * </p>
 *
 * @author hua
 * @since 2024-10-29
 */
public interface LogisticsChannelService extends IService<LogisticsChannelDo> {

    SingleResult addInit();

    Object addLaChannel(LcChannelAddReq req, Long userId, Long tenantId);

    SingleResult updateInit(Long id);

    Object update(LcUpdateReq updateVo, Long userId, Long tenantId);

    void apiCodeUpdate(ApiCodeUpdateReq req, Long userId);

    int delete(Long id, Long userId);

    Object detail(Long id);

    SingleResult pageInit();

    List<LcChannelPageRes> getList(Map<String, Object> map);

    Map<Long, String> getChannelMap(Long tenantId);

    PageResult getListPage(Map<String, Object> map);

    void switchChannel(LaSwitchReq req, Long userId);

    void bindAddress(LcShippingAddressVoAddReq req, Long userId);

    void bindCompany(LcBindCompanyReq req, Long userId);

    /**
     * 带自动选择最便宜的物流方式
     */
    List<LcOptionRes> getLcForChoice(Long warehouseId, Long companyId, Long tenantId);

    List<LcOptionRes> getLcForOut(Long warehouseId, Long companyId, Long tenantId);

    List<LcOptionRes> getLcForOut(String source, Long warehouseId, Long companyId, Long tenantId);

    List<LcOptionRes> getLcList(Long warehouseId, Long companyId, Long tenantId);

}
